home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
COMMUNIC
/
H191.ZIP
/
CA29-3.EXE
/
PC-2-PC.DOC
< prev
next >
Wrap
Text File
|
1992-11-30
|
22KB
|
880 lines
COM-AND Inter-PC File transfer
-----------------------------------------
COM-AND Inter-PC File transfer
Script based file transfer for the IBM PC
-----------------------------------------
COM-AND, and the PC-2-PC script are copyright 1992 by CABER
Software. COM-AND is distributed freely and may be copied by
anyone for any number of machines, for purposes of evaluation.
The author offers COM-AND and its accessory programs as "share-
ware". If you USE the program after evaluating it, you MUST
pay for it.
The complete user license and registration information is to be
found in the file REGISTER.DOC. Limitations on redistribution
of COM-AND are set out in the file VENDOR.DOC. These two files
are included with the COM-AND program release.
CABER Software
R. (Scott) McGinnis
P.O. Box 3607 Mdse Mart
Chicago, IL 60654-0607
GEnie, Delphi: TARTAN
CIS .......... 73147,2665
Internet ..... 73147.2665@compuserve.com
Version 1.1: 921012
COM-AND Inter-PC File transfer
Table of Contents
-----------------
I. Introduction .............................................. page 1
A. What is COM-AND? ........................................ page 1
B. The PC-2-PC script ...................................... page 1
II. Installing the script ...................................... page 2
A. Install COM-AND ......................................... page 2
B. Placing PC-2-PC.CMD ..................................... page 2
C. (optional) Create a batch file to invoke the script ..... page 2
III. Script initialization ...................................... page 3
IV. File transfers ............................................. page 5
A. Wildcard transfer ....................................... page 5
B. Selected file transfer .................................. page 6
V. Exit ....................................................... page 7
VI. DOS gateway ................................................ page 8
VII. Program Requirements ....................................... page 9
VIII. Program and Author Information ............................ page 10
Appendices
----------
A. Null modem ................................................ page 11
B. Async port speeds .......................................... page 12
C. Modem configuration ........................................ page 13
1. DTR ..................................................... page 13
2. CD ...................................................... page 13
3. Modem Escape ............................................ page 14
4. Hangup .................................................. page 14
5. Modem Init .............................................. page 14
Version 1.1: 921012
COM-AND Inter-PC File transfer Page 1
I. Introduction
A. What is COM-AND?
COM-AND for the IBM PC and compatibles is a communications
program for use by itself, or for use with several integrated
accessory programs (which themselves may be used independently of
COM-AND). COM-AND provides standard comm program functions: a
dialing directory, macros, disk logging, binary and ASCII file
transfers, scripted execution and so on.
B. The PC-2-PC script
This document details the PC-2-PC script included with the COM-AND
release. PC-2-PC script supports:
o Direct and dialed connection between two PCs
o Current directory displays for each PC (on both PCs)
o Change drive/directory from either PC, on either PC
o Wild card multiple file transfer from/to either PC
o Selected file transfer from/to either PC
o DOS gateway during connection
Version 1.1: 921012
COM-AND Inter-PC File transfer Page 2
II. Installation
A. Install COM-AND
Refer to the COM-AND release documents (README.DOC and COM-AND.
DOC) for the description of COM-AND installation, please.
B. Placing PC-2-PC.CMD
The script file PC-2-PC.CMD should be placed in the COM-AND
default subdirectory. If you use the environment variable
"COM-AND="..., PC-2-PC should be placed in the subdirectory
indicated by that environment variable. Otherwise, place the
script in the same subdirectory as COM-AND.
C. (optional) Create a batch file to invoke the script
Optionally, you may create a batch file to invoke the script.
PC-2-PC is an interpreted script... and therefore gives the
best performance if executed from a RAMDisk. If you have such a
beast, use it! [Folk more modern (than the author) who use
caching utilities may freely ignore this advice.]
PC-2-PC connects to another machine either through a dialed
number or by direct connect. If you are setting up a direct
connect, using an async port other than the usual modem port (I
myself disable my mouse...), a batch file is particularly helpful.
For example, I have a batch file to invoke this script:
c:
cd\prod
copy pc-2-pc.cmd e:
com-and com1 115k /fe:pc-2-pc
[My default COM-AND subdirectory is C:\PROD. PC-2-PC.CMD is
placed in C:\PROD. My RAMDisk is E:. The mouse serial port
is COM1 (my modem and my COM-AND's default is COM2). "115k" in
COM-AND's run command sets the COM1 async port speed to 115k.
The "/fe:pc-2-pc" in COM-AND's run command executes the script
after COM-AND's load-time initialization.]
Version 1.1: 921012
COM-AND Inter-PC File transfer Page 3
III. Script initialization
When PC-2-PC.CMD is executed by COM-AND, there'll be a pause (the
length of which is determined by the speed of the disk on which the
script resides). At its start, the script 'GOTO's the end, to draw
the window. It may seem a silly way to write a script, but once
COM-AND has read the whole script once, performance is improved
drastically!
The first thing PC-2-PC does is to open a double window. The left
side of the screen always lists files in the current subdirectory
on the current machine. The right side displays the subdirectory on
the other machine once you're connected.
Once the window opens, PC-2-PC begins building and displaying the
current subdirectory. Again, this may take a bit of time... be
patient. When all's done, a window opens over top of the file
list, prompting for action.
At this point, you need to see that COM-AND and the PC-2-PC script
are ready to connect on the machine with which you wish to talk.
Ready both machines. On one, it doesn't matter which, select either:
2) Wait for direct connect
4) Wait for call connect
If you are making a direct connect, you are prompted to allow port
and speed specification(s). A carriage return alone at this point
starts the 'waiting'. If you are making a dialed connect, the script
simply goes into an autoanswer mode waiting for a call.
Version 1.1: 921012
COM-AND Inter-PC File transfer Page 4
III. Script initialization (continued)
On the other machine, then select as appropriate:
1) Direct connect
3) Dial the remote PC
If you are making a direct connect, you are prompted to allow port
and speed specification(s). A carriage return alone at this point
starts connection process. If you are making a dialed connect,
you are asked for a dialing directory number for the number to call
and its parameters. [The script does not display the dialing direc-
tory for you at this time. You need to know it.]
One point to emphasize: The script waiting for connection should
be started first. The script 'making' the connect should then be
started.
If the two scripts recognize each other, they begin by exchanging
subdirectory lists. When the lists have been exchanged, the script
is ready to use. If the two scripts do not connect, check the
settings (speed etc) used on both, and the null-modem (if used) and
try again.
In particular, if you're attempting a direct connect, try a slower
speed connect... the async port used may not be able to handle
very high speeds (see appendix B).
Version 1.1: 921012
COM-AND Inter-PC File transfer Page 5
IV. File Transfers
A. Wildcard transfer
Selection 'W' from the main window prompts for direction (are
you sending or receiving files?) and a wildcard file name.
Select a direction ('S' or 'R'), and specify the file(s) for
transfer. A wildcard file name has the form:
[d:][\path...]<filespec>
where "d:" is an optional drive spec, "\path" is an optional
subdirectory specifier and filespec is a file name with optional
"*"s and "?"s DOS users love and respect. For example:
C:\PROD\COM-AND.*
would move all COM-AND files from one machine to the other. [By
the way, it doesn't hurt anything if you move COM-AND.EXE over the
copy you executed while its executing. It DOES hurt things if you
change the script file... don't touch a script file while its
executing!]
If there is at least one file matching the wildcard specification
you gave, on the appropriate machine, the transfer begins.
If a file being transferred via a wildcard specifier duplicates
a file already existing, the new file's name is modified; a "$"
is placed in the last character position. For example, if you
copied COM-AND.EXE through wildcard transfer into a subdirectory
already containing COM-AND.EXE, the new file would be named:
COM-AND.EX$.
The wildcard transfer moves multiple files from one machine to the
other in one direction at a time. The file name given the sender
may be fully qualified (with drive and path). The receiver places
the files received on the current subdirectory.
Version 1.1: 921012
COM-AND Inter-PC File transfer Page 6
IV. File Transfers (continued)
B. Selected file transfer.
You may select up to 5 files from the current local machine's
window, and 5 files from the current remote machine's window for
transfer. The direction of the transfer is implicit. Files are
selected with a point-and-shoot method:
Cursor right Selects the remote window
Cursor left Selects the local window
PgUp Moves the current window (local or remote)
up 20 files
PgDn Moves the current window (local or remote)
down 20 files
Home Moves the current window (local or remote)
to the first 20 files
End Moves the current window (local or remote)
to the last page of files
Cursor up Moves a scroll bar up the list of files
Cursor down Moves a scroll bar down the list of files
Position the scroll bar to a particular file. Then type 'S'.
A window opens and the current list of selections is displayed.
you are asked to verify the selection with 'y' or 'n'.
With one or more files selected, 'T' begins the transfer.
If a file being transferred via selection duplicates a file
already existing, the old file is replaced by the new file.
The selected transfer moves multiple files from one machine to the
other in any direction. Files must be selected from the current
subdirectory (local and remote)... if you change directory on
either side, the list of selected files is cleared.
The receiver places the files received on its current sub-
directory.
Version 1.1: 921012
COM-AND Inter-PC File transfer Page 7
V. Exit
The PC-2-PC script terminates when ESC or 'E' is pressed in the
main window. [ESC may be used in other windows to cancel a prompt.]
If the script is currently linked to another machine, the script on
the other machine should exit automatically.
If the connection was made via a dialed call, a HANGUP is performed.
Temporary files created by the script are deleted. A general
clean-up is performed.
The PC-2-PC script terminates both itself and COM-AND on exit (you
are returned to the DOS prompt).
You may wish to modify the script to take some other action on exit.
For example, you might wish it simply to exit to COM-AND and not to
DOS. The script is written to have one single exit, labelled "EXIT:"
Code is provided in the "EXIT:" procedure to exit to COM-AND and not
DOS... however, if it is your intention to retain the open line,
beware of the RESET command there. RESET closes the current port and
re-opens the default communications port.
Version 1.1: 921012
COM-AND Inter-PC File transfer Page 8
VI. DOS gateway
At the main window, you may shell-to-DOS at any time with the same
keystroke as used by COM-AND for the purpose: Alt-F10.
If there is memory, a new copy of the SHELL (usually COMMAND.COM) is
executed. A connection, if made, is not lost during a shell
operation (unless you do something like load another comm program!).
When you exit the shell, you are returned to COM-AND and the PC-2-PC
script. If your shell is COMMAND.COM, typing 'exit' terminates the
shell.
Version 1.1: 921012
COM-AND Inter-PC File transfer Page 9
VII. Program requirements
This program can only function on an IBM PC or DOS compatible
machine. COM-AND does direct to screen buffer fetches and stores
(unless BIOS screen updates are directed using the /C switch or the
Alt-O options menu).
COM-AND is TopView aware even without the /C switch or Alt-O option.
COM-AND supports MDA, CGA, EGA and Hercules. COM-AND uses a Micro-
soft Mouse if one is available...
COM-AND disk I/O is done through the 'Handle' oriented I/O routines
added to DOS 2.0. Therefore DOS 2.0 is a minimum requirement.
COM-AND (Version 2.9) requires 277K for itself. You need 384K
take advantage of the DOS Gateway and to load accessories.
This script requires a modem or a null-modem to another computer.
Version 1.1: 921012
COM-AND Inter-PC File transfer Page 10
VIII. Author information
COM-AND was written using Microsoft Macro-Assembler. The author
likes assembler. Assembly language is an entirely appropriate
vehicle for some of the program, and a not-inappropriate vehicle
for the rest of it. Everything, in moderation...
The author of this script is R. Scott McGinnis of Chicago, IL.
My GEnie and Delphi ID: TARTAN, and CIS id: 73147,2665.
Comment and suggestions are welcomed:
CABER Software
R. (Scott) McGinnis
P.O. Box 3607 Mdse Mart
Chicago, IL 60654-0607
My wife, Elizabeth, has made this script and COM-AND itself possible.
She even indulges on-line, now and then! To her I offer my love,
respect and warmest moments <grin>.
This script (Version 1.1) may be distributed freely (but it isn't a
whole lot of use without COM-AND). Any improvements you return to
the author get attention... errors you report get corrected. COM-
AND is shareware. If COM-AND is USED after a 30 day evaluation,
you MUST pay for it. If used for a commercial application, you MUST
pay for it. [Please read REGISTER.DOC.]
Version 1.1: 921012
COM-AND Inter-PC File transfer Page 11
A. Null modem
This script has been used successfully with the following null modem:
DB-25 pin assignments and connections:
-------------------------------------------
RS-232 pins RS-232 pins
----------- -----------
(fg) 1 ---------------------- 1 (fg)
(tx) 2 --------\ /--------- 2 (tx)
X
(rx) 3 --------/ \--------- 3 (rx)
(gnd) 7 ---------------------- 7 (gnd)
(cts) 4 -+ +- 4 (cts)
! !
(rts) 5 -+ +- 5 (rts)
(dsr) 6 -+ +- 6 (dsr)
(cd) 8 -! !- 8 (cd)
! !
(dtr) 20 -+ +- 20 (dtr)
In other words, Pin 2 of one to pin 3 of the other, and pin 3 of the
first to pin 2 of the other. On each side, jumper pins 4 and 5, and
jumper pins 6, 8, and 20. Connect the pin 7s of each machine, and
the pin 1s.
This null modem works for many purposes. This script does not look
at CD if a direct connection is used (CDRESPECT OFF). Tieing CD
to DSR on each side would provide an active carrier detect. Other
applications may work better with other null modem connections.
Pins of a 9 pin shell correlate to the 25 pin shell, as follows:
DB-9: DB-25: Name:
----- ------ -------------------
1 ---- cd ----- 8 Data Carrier Detect
2 ---- rx ----- 3 Receive Data Line
3 ---- tx ----- 2 Transmit Data Line
4 ---- dtr --- 20 Data Terminal Ready
5 ---- gnd ---- 7 Signal Ground
6 ---- dsr ---- 6 Data Set Ready
7 ---- rts ---- 4 Request to Send
8 ---- cts ---- 5 Clear to Send
9 ---- ri ---- 22 Ring Indicator (unused above)
Version 1.1: 921012 Appendices
COM-AND Inter-PC File transfer Page 12
B. Async port speeds
The 8250 UART used in the original asynchronous port (and some
modem) circuits can theoretically run at speed up to 115K bps.
However, in fact, many 8250 chips are found to 'wobble' their
timings at high speeds.
Pin-identical replacement UARTS are available to solve the problem.
An excellent discussion of the problem, and sources for UART re-
placements may be found in Chuck Forsberg's DSZ document.
The capability of one machine's UART determines the maximum speed
of this script. As errors occur, the transfer efficiency drops.
Drastically.
COM-AND implements only 'relaxed' protocols. This means timeouts
are very long in COM-AND - suitable for the network/switched envi-
ronment, but not for direct connects. When a character is dropped,
or errored, COM-AND waits a fixed time before retransmitting or
requesting a retransmit. As the line speed increases, timeouts on
error reduce the overall efficiency.
The CPU clock speed also has its toll. COM-AND is a general purpose
communications program, accommodating software flow control (XON/
XOFF). On slower machines, the overhead to check for XON/XOFF
becomes a limiting factor in the software's capability.
If you use this script, experiment with speed settings. If you find
any improvements, please inform the author.
Version 1.1: 921012 Appendices
COM-AND Inter-PC File transfer Page 13
C. Modem Configuration
COM-AND defaults do not require modem pre-configuration (although
you may do it!). However, certain features cannot be used unless
you configure your modem before you use COM-AND.
1. DTR (Data Terminal Ready)
COM-AND, by default, hangs up using the command sequences defined
through the Alt-S setup (hangup and modem escape). However, you
may alternately select 'Drop DTR to hangup' through the Alt-O
options. Dropping DTR is the only way to hangup certain modems,
and is generally much faster than the command sequences.
Most Hayes compatible modems allow configuration of the DTR sense
through a switch-block. If you wish to use DTR to hangup, be sure
your modem follows the DTR signal. Refer to the documentation
provided with your modem to ensure that option switches are set
appropriately.
2. CD (Carrier Detect)
COM-AND (presently) uses the CD sense line for several purposes.
The 'CONNECT' test supported in the script language, test for
carrier detect upon exit, and the file transfer protocols all
require the modem report carrier detect. True carrier detect
is the only way to determine if you are 'on-line' or 'off-line'.
Many Hayes compatible modems are sold with a carrier detect
override (in other words the modem reports carrier detect all the
time). When carrier detect is overridden, COM-AND cannot detect
when carrier is lost during a file transfer or during a session.
Be sure the modem is reporting true CD (instead of it just saying
'yes'). Most Hayes compatible modems allow configuration of the
CD sense through a switch-block. Refer to the documentation
provided with your modem to ensure that modem switches are set
appropriately.
Version 1.1: 921012 Appendices
COM-AND Inter-PC File transfer Page 14
D. Modem Configuration (continued)
3. Modem Escape
COM-AND issues the "Modem escape" defined through the Alt-S setup,
prior to modem initialization and hangup. Be sure this value is
set correctly in Alt-S.
4. Hangup
COM-AND hangs up using the command sequences defined through the
Alt-S setup (hangup and modem escape) and the drop DTR setting as
discussed above. Be sure these values are set correctly (or see
below).
5. Modem Init
COM-AND transmits a modem initialization when PC-2-PC is set to
await a call. This sequence must enable the modem's autoanswer.
The sequence is defined in the first line of the script. The
value provided is appropriate for most modems. Modify it as
you need. Please refer to your modem's documentation.
Version 1.1: 921012 Appendices